<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="jquery-2.0.0.min.js"></script>
    <style >
        div{
            width: 300px;
            height: 200px;
            border: 1px solid red;
            overflow:auto;
        }
        
    </style>
    <script>
     $(function(){
         $("#btn").click(function(){
            $("#dv").scroll(function(){
                console.log($(this).scrollTop())
            });
         })
     })
    </script>
</head>
<body>
    <input type="button" id="btn" value="button">
    <div id="dv"> 
    hahahahhahahaahhahhahahahhahahaahhahhahahahhah
    ahhahahaahhahhahahahhahahhahahaahhahhahahahhah
    ahaahhahhahahahhahahaahahhahahaahhahhahahahhah
    hahhahahahhahahaahhahhaahhahahaahhahhahahahhah
    hahhahahaahhahhahahahhaahhahahaahhahhahahahhah
    hahaahhahhahahahhahahaaahhahahaahhahhahahahhah
    hhahhahahahhahahaahhahhahhahahaahhahhahahahhah
    ahahhahahaahhahhahahahhahhahahaahhahhahahahhah
    ahahaahhahhahahahhahahaahhahahaahhahhahahahhah
    ahhahhahahahhahahaahhahahhahahaahhahhahahahhah
    hahahhahahaahhahhahahahahhahahaahhahhahahahhah
    hahahaahhahhahahahhahahahhahahaahhahhahahahhah
    aahhahhahahahhahahaahhaahhahahaahhahhahahahhah
    hhahahhahahaahhahhahahaahhahahaahhahhahahahhah
    hhahahaahhahhahahahhahaahhahahaahhahhahahahhah
    haahhahhahahahhahahaahhahahhahahaahhahhahahahhah
    hahahhahahaahhahhahahahahhahahaahhahhahahahhah
    hahahaahhahhahahahhahahahhahahaahhahhahahahhah
    aahhahhahahahhahahaahhahahhahahaahhahhahahahhah
    </div>
   

    
    
</body>
</html>